package cn.itheima.dao.takedelivery;

import cn.itheima.domain.Promotion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;

/**
 * Created by millions on 2017/7/7.
 */
public interface PromotionRepository extends JpaRepository<Promotion,Integer>{

    @Query("update Promotion set status=2 where endDate<? and status=1")
    @Modifying
    void updateStatus(Date date);
}
